import Mock, { mock } from "mockjs";
// var Mock = require('mockjs')
var Random = Mock.Random;

let data_success = {
    status:'ok', //账号密码正确 登录成功
    data:{
        id: 9567, //商品id
        nickname: "aaddd", //所属人
        token:Random.guid(),
        email: "12345678911@163.com",
        phone: "12345678911",
        image: Random.image("100x100", "#FF6600"), //图片
        time: '@datetime("2022-MM-dd A HH:mm:ss")',
      },
}

let data_error = {
    status:"error", //表示登录失败,
}


export default Mock.mock(
    '/api/login/account','post',
    (req)=>{
        // console.log(req);
        // console.log(req);
        let req_data= JSON.parse(req.body)
        if(req_data.username ==='admin' && req_data.password==='123456'){
            return data_success;
           
        }
        return data_error;
    }
)